package cn.cdu.medical.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonInclude;

import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@Table(name = "chat_massage")
@TableName("chat_message")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ChatMessage implements Serializable {
    private static final long serialVersionUID = 1L;
    
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    
    @TableField("consultation_id")
    private String consultationId;
    
    @TableField("user_id")
    private Long userId;
    
    /**
     * 消息内容，使用TEXT类型存储
     * 最大支持65KB文本
     */
    @TableField(value = "content", typeHandler = org.apache.ibatis.type.StringTypeHandler.class)
    private String content;
    
    /**
     * 消息类型：user-用户消息，ai-AI回复
     */
    @TableField("type")
    private String type;
    
    @TableField("create_time")
    private LocalDateTime createTime;
} 
 
 
 